package com.globo.opensocial.tests;

import org.htmlparser.nodes.TagNode;

import com.globo.opensocial.Util;
import com.globo.opensocial.tags.ForTag;
import com.globo.opensocial.tags.IfTag;
import com.globo.opensocial.tags.IncludeTag;

import junit.framework.TestCase;

public class UtilCase extends TestCase {

	public final void testCreteElementById() {

		StringBuilder tmp = new StringBuilder();

		Util.creteElementById("name", "instance", tmp);

		System.out.println(tmp.toString());
	
		assertEquals(tmp.toString(), "var instance = osg.E(\"name\");\n");
	}

	public final void testGetMethodNameStringString() {
		fail("Not yet implemented"); // TODO
	}

	public final void testGetMethodNameStringStringString() {
		fail("Not yet implemented"); // TODO
	}

	public final void testIsSpecialTag() {
		
		assertTrue(Util.isSpecialTag(new IfTag()));
		assertTrue(Util.isSpecialTag(new ForTag()));
		assertTrue(Util.isSpecialTag(new IncludeTag()));
		
	}

	public final void testAppendInclude() {
		
		StringBuilder tmp = new StringBuilder();

		Util.appendInclude("template", tmp);

		System.out.println(tmp.toString());
	
		assertEquals(tmp.toString(), "getTemplatePage(__td)");		
		
	}

}
